package com.woniu.woniuk16.controller;


import com.woniu.woniuk16.dto.RuleDto;
import com.woniu.woniuk16.model.Result;
import com.woniu.woniuk16.service.WoniuRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tiangle
 * @since 2021-12-17
 */
@RestController
@RequestMapping("/woniuRule")
public class WoniuRuleController {
    @Autowired
    private WoniuRuleService woniuRuleService;

    @GetMapping("/all")
    public Result getRules(){
        List<RuleDto> rules = woniuRuleService.getRules();
        return Result.getInstance(rules);
    }



}

